﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using MySql.Data.Types;

namespace Projectkeuzemenu
{
    public partial class Projectkeuzemenu : Form
    {
        //waarden van de ingelogde persoon
        int userID;
        int projectAmount;

        //title en description voor home page
        string defaultTitle = "Welkom bij GrabCollab!";
        string defaultDescription = "Kies één van de projecten uit het menu om te beginnen";
        
        //hier komen title en description voor de projecten in
        string username;
        string password;
        string titel;
        string desc;
        string titel2;
        string desc2;
        string titel3;
        string desc3;
        string titel4;
        string desc4;
        string titel5;
        string desc5;
        int projectid1;
        int projectid2;
        int projectid3;
        int projectid4;
        int projectid5;
        int project;
       
        
        public Projectkeuzemenu()
        {

        }

        public Projectkeuzemenu(int userid, string name, string pass, int projectAmount, string title, string description, string title2, string description2, string title3, string description3, string title4, string description4, string title5, string description5, int project1, int project2, int project3, int project4, int project5)
        {
            userID = userid;
            username = name;
            password = pass;
            titel = title;
            desc = description;
            titel2 = title2;
            desc2 = description2;
            titel3 = title3;
            desc3 = description3;
            titel4 = title4;
            desc4 = description4;
            titel5 = title5;
            desc5 = description5;
            projectid1 = project1;
            projectid2 = project2;
            projectid3 = project3;
            projectid4 = project4;
            projectid5 = project5;

            InitializeComponent();
            labelTitle.Text = defaultTitle;
            labelDescription.Text = defaultDescription;
            btnStart.Hide();

            switch (projectAmount)
            {
                case 1:
                    btnProject1.Show();
                    btnProject2.Hide();
                    btnProject3.Hide();
                    btnProject4.Hide();
                    btnProject5.Hide();
                    break;
                case 2:
                    btnProject1.Show();
                    btnProject2.Show();
                    btnProject3.Hide();
                    btnProject4.Hide();
                    btnProject5.Hide();
                    break;
                case 3:
                    btnProject1.Show();
                    btnProject2.Show();
                    btnProject3.Show();
                    btnProject4.Hide();
                    btnProject5.Hide();
                    break;
                case 4:
                    btnProject1.Show();
                    btnProject2.Show();
                    btnProject3.Show();
                    btnProject4.Show();
                    btnProject5.Hide();
                    break;
                case 5:
                    btnProject1.Show();
                    btnProject2.Show();
                    btnProject3.Show();
                    btnProject4.Show();
                    btnProject5.Show();
                    break;
            }
        }

        private void btnHome_Click(object sender, EventArgs e)
        {
            labelTitle.Text = defaultTitle;
            labelDescription.Text = defaultDescription;
            btnStart.Hide();
        }

        private void btnProject1_Click(object sender, EventArgs e)
        {
            project = projectid1;
            labelTitle.Text = titel;
            labelDescription.Text = desc;
            btnStart.Show();
        }

        private void btnProject2_Click(object sender, EventArgs e)
        {
            project = projectid2;
            labelTitle.Text = titel2;
            labelDescription.Text = desc2;
            btnStart.Show();
        }

        private void btnProject3_Click(object sender, EventArgs e)
        {
            project = projectid3;
            labelTitle.Text = titel3;
            labelDescription.Text = desc3;
            btnStart.Show();
        }

        private void btnProject4_Click(object sender, EventArgs e)
        {
            project = projectid4;
            labelTitle.Text = titel4;
            labelDescription.Text = desc4;
            btnStart.Show();
        }

        private void btnProject5_Click(object sender, EventArgs e)
        {
            project = projectid5;
            labelTitle.Text = titel5;
            labelDescription.Text = desc5;
            btnStart.Show();
        }

        private void buttonStart_Click(object sender, EventArgs e)
        {
            //GUI launchen met correcte variabelen
            this.Dispose(false);
            Gui.Interface gui = new Gui.Interface(project, userID);
            gui.Show();
        }

        private void panelMain_Paint(object sender, PaintEventArgs e)
        {

        }
    }
}
